#include <Windows.h>
#include <Commctrl.h>
#include "win_base.h"
#include "win_frame.h"


class win_splitter : public win_tile, public win_base
{
public:
    win_splitter();
    ~win_splitter();

    void        set_margin(int iMargin) { _iSplitterMargin = iMargin; }

public:
    virtual int fit(const RECT &rcFragment);
    virtual int fit_last(const RECT &rcFragment);

    virtual LRESULT OnPaint();
	virtual LRESULT OnLeftDown(WORD x, WORD y, BOOL bCtrlDown, BOOL bShiftDown);
	virtual LRESULT OnLeftUp(WORD x, WORD y, BOOL bCtrlDown, BOOL bShiftDown);
	virtual LRESULT OnMouseMove(DWORD dwKeys, WORD x, WORD y);

protected:
    int     _iSplitterMargin, _iMarginOnDraged;
    bool    _isDragging;
    POINT   _ptDrag;
};
